package ar.uba.fi.tp2Unit;

import ar.uba.fi.tp2Unit.assertions.Assertion;
import ar.uba.fi.tp2Unit.framework.TestCase;
import ar.uba.fi.tp2Unit.framework.TestFixture;
import ar.uba.fi.tp2Unit.framework.TestNameAlreadyExistsException;
import ar.uba.fi.tp2Unit.framework.TestSuite;

public class MyTestWithFailAndError extends TestSuite {

	
	public MyTestWithFailAndError(String name) throws TestNameAlreadyExistsException {
		super(name);
		this.addTest(new TestThatFails("TestThatFails"));
		this.addTest(new TestThatThrowsException("TestThatThrowsException"));
	}
	
	class TestThatFails extends TestCase{

		public TestThatFails(String name) {
			super(name);
		}

		@Override
		public void testMethod(TestFixture testFixture) throws Throwable {
			Assertion.assertFalse("Ey! debería haber sido false.", true);
		}
		
	}

	class TestThatThrowsException extends TestCase{

		public TestThatThrowsException(String name) {
			super(name);
		}

		@Override
		public void testMethod(TestFixture testFixture) throws Throwable {
			int number = 8;
			int zero = 0;
			Assertion.assertNotNull(number/zero);
		}
		
	}
}
